package com.prueba.client.datos;

import com.smartgwt.client.data.DataSource;  
import com.smartgwt.client.data.fields.DataSourceTextField;  

public class PreferenciasData extends DataSource {  
  
    private static PreferenciasData instance = null;  
  
    public static PreferenciasData getInstance() {  
        if (instance == null) {  
            instance = new PreferenciasData();  
        }  
        return instance;  
    }  
  
    public PreferenciasData() {  
  
        setID("Preferencias");  //para marcar foreing key desde otros datasource
        //setTitleField("Preferencias");  
        setRecordXPath("/lista/preferencia");  //para indicar la ruta en el xml??
    	
        DataSourceTextField stakeholder=new DataSourceTextField("stakeholder", "Stakeholder");
        stakeholder.setForeignKey("Stakeholders.stakeholder");  
        stakeholder.setRequired(true);  

        DataSourceTextField decomposition=new DataSourceTextField("decomposition", "Decomposition");
        decomposition.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField uses=new DataSourceTextField("uses", "Uses");
        uses.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField generalization=new DataSourceTextField("generalization", "Generalization");
        generalization.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField layered=new DataSourceTextField("layered", "Layered");
        layered.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField dataModel=new DataSourceTextField("dataModel", "DataModel");
        dataModel.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField various=new DataSourceTextField("various", "Various");
        various.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField deployment=new DataSourceTextField("deployment", "Deployment");
        deployment.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField implementation=new DataSourceTextField("implementation", "Implementation");
        implementation.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField install=new DataSourceTextField("install", "Install");
        install.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField workAssignment=new DataSourceTextField("workAssignment", "WorkAssignment");
        workAssignment.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        DataSourceTextField others=new DataSourceTextField("others", "Others");
        others.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
        
        
        
		
        
        //ver lo del primary key
        
        setFields(stakeholder,decomposition,uses,generalization,layered,dataModel,various,deployment,implementation,install,workAssignment,others);  
        setDataURL("datos/preferencias.xml");  
        setClientOnly(true);  //para indicar que los datos estan en el cliente?? 
        //porque esta operacion cambia la logica??

    }  	
}  